<div class="box">
    
  <div class="box-header">

    <div class="row">

        <div class="col-sm-7">
            <div class="box-tools search-form pull-right">
                <div class="input-group input-group-sm">

					<select name="type" class="pull-right form-control" style="width:120px">
						<option value='desc'>降序</option>
						<option value='asc'>升序</option>
					</select>
					<select name="sort" class="pull-right form-control" style="width:120px">
						<option value='login_time'>活跃时间</option>
						<option value='create_time'>注册时间</option>
						<option value='moneyMy'>现金余额</option>
					</select>

                    <div class="input-group-btn">
                      <button type="button" id="search"  url="{:url('userOrderList')}" class="btn btn-info btn-flat"><i class="fa fa-search"></i>排序</button>
                    </div>

                </div>
           </div>
        </div>
    </div>
    
  </div>
    
    
  <div class="box-body table-responsive">
    <table  class="table table-bordered table-hover">
      <thead>
      <tr>
		  <th class="checkbox-select-all">
			  <label>
				  <input class="flat-grey js-checkbox-all" type="checkbox">
			  </label>
		  </th>
		  <th>ID</th>
		  <th>头像</th>
          <th>用户名</th>
		  <th>直推人数</th>
		  <th>团队总数</th>
		  <th>用户类型</th>
		  <th>现金余额</th>
		  <th>MDC</th>
          <th>注册时间</th>
		  <th>推荐人</th>
		  <th>活跃时间</th>
		  <th>状态</th>
      </tr>
      </thead>
      
      {notempty name='list'}
        <tbody>
            {volist name='list' id='vo'}
                <tr>
				<td>
					<label>
						<input class="flat-grey" type="checkbox" name="ids" value="{$vo.id}">
					</label>
				</td>
				  <td>{$vo.id}</td>
				  <td><a Onclick="imgck('{$vo.headimg|default=''}')" target="_blank" data-lightbox="gallery" data-title="{$vo.headimg| default='/upload/headimg.png'}" > <img src='{$vo.headimg|default="/upload/headimg.png"}'  width="50" height="50" style="border-radius:50%"/></a></td>
				  <td>{$vo.username}<br/><span style="color:red">{$vo.name}</span></td>
				  <td><a href="{:url('userList', array('tjid' => $vo['id']))}" >{$vo.num}</a></td>
				  <td>{$vo.sum}</td>
				  <td>{if $vo.is == 1}个人{else}<span style="color:red">企业</span>{if $vo.gsrz == 1}（已认证）{/if}{/if}</td>
				  <td><a href="{:url('moneyyj', array('user_id' => $vo['id']))}" >{$vo.moneyMy}</a></td>
				  <td><a href="{:url('money/moneylist', array('user_id' => $vo['id']))}" >{$vo.mdc}</a></td>
                  <td>{$vo.create_time}</td>
                  <td>{$vo.tjusername}<br/><span style="color:red">{$vo.tjname}</span></td>
				  <td>{$vo.login_time}</td>
					<td>
						<ob_link><a class="ajax-get" href="{:url('setStatus', array('ids' => $vo['id'], 'status' => (int)!$vo['status']))}">{$vo.status_text}</a></ob_link>
					</td>
                </tr>
            {/volist}
        </tbody>
        {else/}
        <tbody><tr class="odd"><td colspan="8" class="text-center" valign="top">{:config('empty_list_describe')}</td></tr></tbody>
      {/notempty}
    </table>
  </div>
<div class="box-footer">
	<ob_link><a class="btn batch_btn confirm ajax-post" value="{$Think.DATA_NORMAL}"  href="{:url('setStatus')}"><i class="fa fa-check-circle"></i> 启 用</a></ob_link>
	<ob_link><a class="btn batch_btn confirm ajax-post" value="{$Think.DATA_DISABLE}" href="{:url('setStatus')}"><i class="fa fa-times-circle"></i> 禁 用</a></ob_link>
	<a class="btn" onclick="javascript:history.back(-1);return false;"><i class="fa fa-history"></i> 返 回</a>
</div>
  <div class="box-footer clearfix text-center">
      {$list->render()}
  </div>

</div>

<script>
    //导出功能
    $(".export").click(function(){
        window.location.href = searchFormUrl($(".export"));
    });
	function bfqx(id){
		layer.confirm('请您选择拨付类型！', {
		  btn: ['简历查看','发布职位'] //按钮
		}, function(){
			layer.prompt({title: '输入拨付次数', formType: 4},function(val, index){
				if(isNaN(val)){
					layer.msg("请输入正确的数字");
					return false;
				}
			    $.post("{:url('editNum')}",{resumeNum:val,user_id:id},function(data){
					if(data.code == 0){
						layer.msg(data.msg);
						location.reload();
					}else{
						layer.msg(data.msg);
					}
				},'json');
			});
		}, function(){
			layer.prompt({title: '输入拨付次数', formType: 4},function(vals, index){
				if(isNaN(vals)){
					layer.msg("请输入正确的数字");
					return false;
				}
			    $.post("{:url('editNum')}",{workNum:vals,user_id:id},function(data){
					if(data.code == 0){
						layer.msg(data.msg);
						location.reload();
					}else{
						layer.msg(data.msg);
					}
				},'json');
			});
	    });
	}
	//拨付
	function bfMoney(id){
		layer.prompt({title: '输入拨付金额', formType: 4},function(val, index){
			if(isNaN(val)){
				layer.msg("请输入正确的数字");
				return false;
			}
			$.post("{:url('editMoney')}",{money:val,user_id:id},function(data){
				if(data.code == 0){
					layer.msg(data.msg);
					location.reload();
				}else{
					layer.msg(data.msg);
				}
			},'json');
		});
	}
	//重置密码
	function resetPassword(id){
		password=<?php echo config('reset_password');?>;
		layer.confirm('重置密码为：<span style="color:red">'+password+'</span>，确定重置密码？', {
		  time: 0 //不自动关闭
		  ,btn: ['确定', '取消']
		  ,yes: function(index){
			layer.close(index);
			$.post("{:url('resetPassword')}",{id:id,password:password},function(data){
				if(data.code == 0){
					layer.msg(data.msg);
					location.reload();
				}else{
					layer.msg(data.msg);
				}
			},'json');
		  }
		});
	}
</script>